import React, { useEffect, useState } from "react";
import Camera, { getUserMedia } from "../dist";
import { useNavigate } from "react-router-dom";

function App() {
  const history = useNavigate();
  const play = () => {
    getUserMedia().then((res) => {
      console.log(res);
      if (res.success) {
        history("/result");
      }
    });
  };
  return (
    <div className="App">
      <h1>Preact Demo</h1>
      <span onClick={play}>去刷脸</span>
    </div>
  );
}

export default App;
